package com.chenyun.system.generator.model;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 数据源管理对象 gen_datasource_store
 * 
 * @author ruoyi
 * @date 2022-06-27
 */
public class GenDatasourceStore
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private String id;

    /** $column.columnComment */
    private String dataSourceName;

    /** $column.columnComment */
    private String driverName;

    /** $column.columnComment */
    private String userName;

    /** $column.columnComment */
    private String pwd;

    /** $column.columnComment */
    private String url;

    @TableField(exist = false)
    private String jdbcUrl;

    /** $column.columnComment */
    private String remarke;

    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }
    public void setDataSourceName(String dataSourceName) 
    {
        this.dataSourceName = dataSourceName;
    }

    public String getDataSourceName() 
    {
        return dataSourceName;
    }
    public void setDriverName(String driverName) 
    {
        this.driverName = driverName;
    }

    public String getDriverName() 
    {
        return driverName;
    }
    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }
    public void setPwd(String pwd) 
    {
        this.pwd = pwd;
    }

    public String getPwd() 
    {
        return pwd;
    }
    public void setUrl(String url) 
    {
        this.url = url;
    }

    public String getUrl() 
    {
        return url;
    }
    public void setRemarke(String remarke) 
    {
        this.remarke = remarke;
    }

    public String getRemarke() 
    {
        return remarke;
    }

    public String getJdbcUrl() {

        return StrUtil.isNotBlank(jdbcUrl)?jdbcUrl:url;
    }

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("dataSourceName", getDataSourceName())
            .append("driverName", getDriverName())
            .append("userName", getUserName())
            .append("pwd", getPwd())
            .append("url", getUrl())
            .append("remarke", getRemarke())
            .toString();
    }
}
